<?php

namespace app\Admin\model;

use think\Model;
use traits\model\SoftDelete;

class System extends Model
{
    //
    protected $table = 'system';
    use SoftDelete;

    protected $deleteTime = 'delete_time';


    public function getAll()
    {
        $data = System::paginate(3);
        return $data;
    }

    public function delSys($id)
    {
        return System::destroy($id);
    }

    public function active($data)
    {
        $sys = new System;
       return $sys->save($data, ['id' => $data['id']]);
    }

    public function getOne($id){
        return System::get($id)->toArray();
    }
}
